/* 
* Copyright (C) 2011-2018 ShenZhen iBOXSaaS Information Technology Co.,Ltd. 
* 
* All right reserved. 
* 
* This software is the confidential and proprietary 
* information of iBOXSaaS Company of China. 
* ("Confidential Information"). You shall not disclose 
* such Confidential Information and shall use it only 
* in accordance with the terms of the contract agreement 
* you entered into with iBOXSaaS inc. 
* 
*/

package com.iboxpay.open.auth.center.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.collections.MapUtils;
import org.iboxpay.open.common.constants.ParamEnums;
import org.iboxpay.open.common.constants.ResultEnums;
import org.springframework.stereotype.Service;

import com.iboxpay.open.auth.center.service.BizSysAuthService;

/**
 * 
 * BizSysAuthServiceImpl.java
 * @author xuxiao
 * @date 2018/06/27
 */
@Service
public class BizSysAuthServiceImpl implements BizSysAuthService {

    @Override
    public Map<String, Object> userLoginValidate(Map<String, String> param) {
        Map<String, Object> result = new HashMap<>();
        // TODO 根据业务系统进行调整
        // 目前为测试实现
        String auth = MapUtils.getString(param, "auth");
        if("0".equals(auth)) {
            result.put(ParamEnums.resultCode.getCode(), ResultEnums.success.getCode());
            result.put(ParamEnums.userId.getCode(), MapUtils.getString(param, ParamEnums.userId.getCode()));
            return result;
        }
        result.put(ParamEnums.resultCode.getCode(), ResultEnums.userLoginValidateError.getCode());
        return result;
    }

}
